<% layout('/layouts/default.html', {title: '详情', libs: ['validate','fileupload','ueditor','dataGrid']}){ %>
<style>
	.box-info{
		padding: 20px;
		background-color: white;
	}
	.image-img{
		width: 120px;
		height: 100px;
	}
	.bg-white{
		background-color: white;
	}
</style>
<div class="main-content print-form">
	<div class="box-info">
		<table class="table-form bg-gray-light" width="100%">
			<tr class="form-title"><td colspan="6">基本信息</td></tr>
			<tr>
				<td class="form-label width-160">机车名称</td>
				<td>${car.carTitle}</td>
				<td class="form-label width-160">标签</td>
				<td>${car.carLabel}</td>
			</tr>
			<tr>
				<td class="form-label">公里数</td>
				<td>${car.kilometer}</td>
				<td class="form-label">品牌</td>
				<td>${car.brand}</td>
			</tr>
			<tr>
				<td class="form-label">过户次数</td>
				<td>${car.transfers} 次</td>
				<td class="form-label">上户日期</td>
				<td>${car.showDate}</td>
			</tr>
			<tr>
				<td class="form-label">售价</td>
				<td>${car.showSellPrice} 元</td>
				<td class="form-label">缸数</td>
				<td>${car.cylinder}</td>
			</tr>
			<tr>
				<td class="form-label">详细说明</td>
				<td colspan="4">${car.explain}</td>
			</tr>
			<tr class="form-title"><td colspan="6">图片信息</td></tr>
			<tr>
				<td class="form-label">封面图</td>
				<td colspan="4">
					<img class="image-img" src="${car.coverUrl}" onclick="lookImage(this)" data-path="${car.coverUrl}">
				</td>
			</tr>
			<tr>
				<td class="form-label">轮播图</td>
				<td colspan="4">
					<% var i=0;for(var item in carList){ %>
					<img class="image-img" src="${item}" onclick="lookImage(this)" data-path="${item}">
					<% } %>
				</td>
			</tr>
			<tr>
				<td class="form-label">详情图</td>
				<td colspan="4">
					<% var k=0;for(var item in detailList){ %>
					<img class="image-img" src="${item}" onclick="lookImage(this)" data-path="${item}">
					<% } %>
				</td>
			</tr>
			<tr class="form-title"><td colspan="6">留言信息</td></tr>
			<tr>
				<td colspan="5">
					<textarea rows="5" class="form-control autoHeight" readonly>${car.remarks}</textarea>
				</td>
			</tr>
			<tr class="form-title"><td colspan="6">审核信息</td></tr>
			<tr class="bg-white">
				<td class="form-label">审核结果</td>
				<td colspan="4">
					<#form:select path="examineResult" defaultValue="${examine.examineResult}" dictType="h_examine_result" class="form-control required" />
				</td>
			</tr>
			<tr class="bg-white">
				<td class="form-label">审核内容</td>
				<td colspan="4">
					<#form:textarea path="examineContent" defaultValue="${examine.examineContent}" rows="5" class="form-control autoHeight" placeholder="请输入审核内容" />
				</td>
			</tr>
		</table>
		<div class="box-footer" id="footer">
			<div class="row">
				<div class="col-sm-offset-5 col-sm-10">
					<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('保 存')}</button>&nbsp;
					<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
				</div>
			</div>
		</div>
	</div>
</div>
<% } %>
<script>
	if('${parameter.isEdit}'=='f'){
		$('#footer').hide();
		$('#examineResult').attr('disabled',true);
		$('#examineContent').attr('disabled',true);
	}
	$('#btnSubmit').click(function () {
		js.confirm('确认提交吗？', '${ctx}/examine/examine/save',
				{"carId": '${car.carId}',
				"examineResult": $('#examineResult').val(),
				"examineContent": $('#examineContent').val()},
		function (res) {
			js.showMessage(res.message);
			if(res.result == Global.TRUE){
				js.closeCurrentTabPage(function(contentWindow){
					contentWindow.page();
				});
			}
		}, 'json', true, '正在提交...')
	});
	function lookImage(e) {
		let img = $(e).data('path');
		js.layer.photos({
			photos: {
				"title": "Photos Demo",
				"start": 0,
				"data": [
					{
						"alt": "图片",
						"pid": 0,
						"src": img
					}
				]
			},
			footer: false
		});
	}
</script>